Semiconductor devices in which semiconductor elements are Hall elements, for example, are applied to various electronic devices such as mobile phones. For example, in the case of controlling the light source of the display of a mobile phone, application of such a semiconductor device enables control for turning the light source on and off to be performed, by opening and closing the main body of the mobile phone.